//
// Created by lxinp on 2022/8/9.
//

#ifndef DATASTRUCTURE_STACK_H
#define DATASTRUCTURE_STACK_H


template<typename T>
class Stack {
public:
    Stack();
    bool is_empty();
    void push(T elt);
    void pop();
    T get_top();
    void print();
    ~Stack();

private:
    struct Node {
        T elt;
        Node* next;
        explicit Node(const T& elt, Node* next=nullptr) : elt(elt), next(next) {}
    };
    Node* top;
};


#endif //DATASTRUCTURE_STACK_H
